<template>
  <div class="block">
    <el-timeline>
      <el-timeline-item v-for="(item,index) of timeline" :key="index" :timestamp="item.timestamp" placement="top">
        <el-card>
          <h4>{{ item.title }}</h4>
          <p>{{ item.content }}</p>
        </el-card>
      </el-timeline-item>
    </el-timeline>
  </div>
</template>

<script>
export default {
  data() {
    return {

    }
  },
  computed: {
    timeline() {
      return [
        {
          timestamp: this.$store.getters.loginTime.toLocaleString(),
          title: '登陆',
          content: '上线了 o(*￣▽￣*)ブ'
        }
      ]
    }
  },
  created() {
    if (!this.$store.getters.loginTime) {
      this.$store.commit('user/SET_LOGINTIME', new Date())
    }
  }
}
</script>
